<?php
header("Content-type:text/html; charset=utf-8");
include_once 'sys/conn/conn.php';
$pagesize=15;
$total = mysql_fetch_array(mysql_query("select count(*) from tb_content where c_type='政策法规'"));//查询数据库中一共有多少条数据 
$Total = $total[0]; // 
$Totalpage = ceil($Total/$pagesize);//上舍，取整 
if(!isset($_GET['page'])||!intval($_GET['page'])||$_GET['page']>$Totalpage||$_GET['page']<1){ 
	$page=1; 
}else { 
	$page=$_GET['page'];//如果不满足以上四种情况，则page的值为$_GET['page'] 
} 
$startnum = ($page-1)*$pagesize;//开始条数 
$sql = "select * from tb_content where c_type='政策法规' order by id desc limit $startnum,$pagesize";//查询出所需要的条数 
$rs = mysql_query($sql); 
while ($contents = mysql_fetch_array($rs)){
	$result[] = $contents;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中科智远--新闻中心</title>
<link rel="stylesheet" href="style/style.css" type="text/css" />
<link rel="stylesheet" href="style/select2css.css" type="text/css" />
</head>

<body>
	<?php include_once 'header.php';?>
    <div class="menu">
    	<ul>
        	<li class="home"><a href="index.php" target="_self">首页</a></li>
            <li class="aboutZY"><a href="aboutZY.php" target="_self">关于智远</a>
			<li class="news news_st"><a href="news.php" target="_self">新闻中心</a></li>
            <li class="products"><a href="spjk.php" target="_self">产品中心</a></li>
			<li class="kf"><a href="services.php" target="_self">客服中心</a></li>
            <li class="joinUs"><a href="joinUs.php" target="_self">加入我们</a></li>
        </ul>
        <div class="language">
            <div id="uboxstyle">
                <select name="language" id="language">
                    <option value="English">English</option>
                    <option value="简体中文" selected="selected">简体中文</option>
                </select>
            </div>
            <script type="text/javascript" src="js/select2css.js"></script>
        </div>
    </div>
    <div class="normal"><img src="images/news.jpg" width="938" height="106" alt="新闻中心" /></div>
    <div class="shadow"><img src="images/shadow.jpg" width="946" height="22" alt="" /></div>
    <div class="middle">
    	<div class="left">
        	<div class="list_tit">新闻中心</div>
            <div class="list">
            	<ul>
                	<li><a href="list_company_news.php" target="_self">公司新闻</a><a href="list_hydt.php" target="_self">行业动态</a><a href="zcfg.php" target="_self">政策法规</a></li>
                </ul>
            </div>
            <div class="list_bot"><img src="images/list_bot.png" width="182" height="24" alt="list_bot" /></div>
        </div>
        <div class="right">
        	<div class="content_addr">所在位置：<a href="news.php" target="_self">新闻中心</a>&nbsp;&gt;&nbsp;政策法规</div>
            <div class="content">
            	<div class="newslist">
                    <ul>
                        <?php 
                    	foreach ($result as $row){
                    ?>
                        <li><a href="news_article.php?id=<?php echo $row["id"];?>" target="_self"><?php echo $row["title"];?></a><span><?php echo $row["uptime"];?></span></li>
                    <?php 
                    	}
                    ?>
                    </ul>
                </div>
                <div class="page">
                	<?php
					if($total){
						$per = $page - 1;//上一页
						$next = $page + 1;//下一页
						echo "共有".$Total."条记录&nbsp;&nbsp;每页".$pagesize."条&nbsp;&nbsp;共".$Totalpage."页 ";
						if($page != 1){
							echo "<a href='".$_SERVER['PHP_SELF']."'>首页</a>&nbsp;&nbsp;";
							echo "<a href='".$_SERVER['PHP_SELF'].'?page='.$per."'> 上一页</a>&nbsp;&nbsp;";
						}
						if($page != $Totalpage){
							echo "<a href='".$_SERVER['PHP_SELF'].'?page='.$next."'> 下一页</a>&nbsp;&nbsp;";
							echo "<a href='".$_SERVER['PHP_SELF'].'?page='.$Totalpage."'> 尾页</a>";
						}
					}
					?>
                </div>
            </div>
            <div class="content_bot"><img src="images/content_bot.png" width="756" height="10" alt="content_bot" /></div>
        </div>
    </div>
    <?php include_once 'footer.php';?>
</body>
</html>